package com.geekbang.work10;

import com.geekbang.work10.mapper.StudentMapper;
import com.geekbang.work10.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author nhsoft.lul
 */
@SpringBootApplication
@ComponentScan(basePackages = {"com.geekbang.work10"})
@RestController
public class ShardingSphereApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShardingSphereApplication.class, args);
    }

    @Autowired
    private StudentMapper studentMapper;

    @RequestMapping("test")
    public String test(){
        System.out.println(studentMapper.list());
        Student student = new Student();
        student.setStudentId(1);
        student.setStudentName("lul");
        studentMapper.save(student);
        System.out.println(studentMapper.list());
        return "SUCCESS";
    }
}
